<!-- 最近看过的频道 -->
<template>
	<div class="channel-box">
		<div class="channels" :style="{marginLeft: -index*100+'%'}">
			<router-link class="item" :to="'/channel/'+item.id" v-for="(item,index) in list" :key="item.id" :class="{last:(index+1)%5 == 0}">
				<img class="item-img" :src="item.cover" />
				<div class="item-name">{{item.name}}</div>
				<div class="item-text">看过该频道的视频</div>
			</router-link>
		</div>
	</div>
</template>

<script>
export default{
	props:{
		list:{
			type: Array,
			required: true
		},
		index:{
			type: Number,
			default: 0
		}
	}
}
</script>

<style scoped lang="less">
.channel-box{
	position: relative;
	margin-bottom: 40px;
	width: 100%;
	z-index: 8;
	overflow: hidden;
	.channels{
		display: flex;
		transition: margin-left 1s;
		.item{
			padding: 16px 10px;
			margin-right: 10px;
			display: flex;
			flex-direction: column;
			flex-shrink: 0;
			align-items: center;
			min-width: 150px;
			border-radius: 2px;
			transition: height .3s;
			font-size: 18px;
			cursor: pointer;
			background-color: #fff;
			&.last{
				margin-right: 0;
			}
			.item-img{
				width: 48px;
				height: 48px;
				margin-bottom: 10px;
				border-radius: 2px;
			}
			.item-name{
				margin-bottom: 4px;
				line-height: 18px;
				font-size: 14px;
			}
			.item-text{
				margin-bottom: 4.8px;
				line-height: 18px;
				font-size: 12px;
				color: #999;
			}
		}
	}
}
</style>
